package com.qf.fmall2203.product.service;

import com.qf.fmall2203.product.entity.ProductComments;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.HashMap;

/**
 * <p>
 * 商品评价  服务类
 * </p>
 *
 * @author dongjl
 * @since 2023-02-15
 */
public interface IProductCommentsService extends IService<ProductComments> {

    /**
     * 分页查询商品评论信息
     * @param id 商品id
     * @param pageNum 当前页号
     * @param limit 页大小
     * @return map的key包含，pageCount，count，list
     */
    HashMap<String, Object> detailCommonts(Integer id, Integer pageNum, Integer limit);

    /**
     * 查询商品好评率
     * @param id 商品id
     * @return
     *     "data": {
     *         "goodTotal": 4,
     *         "total": 7,
     *         "badTotal": 1,
     *         "midTotal": 2,
     *         "percent": "0.57"
     *     }
     */
    HashMap<String, Object> detailCommontscount(Integer id);
}
